\(\int (a-a \sin ^2(x)) \, dx\) [31]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 9, antiderivative size = 16 \[ \int \left (a-a \sin ^2(x)\right ) \, dx=\frac {a x}{2}+\frac {1}{2} a \cos (x) \sin (x) \]

[Out]

1/2*a*x+1/2*a*cos(x)*sin(x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2715, 8} \[ \int \left (a-a \sin ^2(x)\right ) \, dx=\frac {a x}{2}+\frac {1}{2} a \sin (x) \cos (x) \]

[In]

Int[a - a*Sin[x]^2,x]

[Out]

(a*x)/2 + (a*Cos[x]*Sin[x])/2

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rubi steps \begin{align*} \text {integral}& = a x-a \int \sin ^2(x) \, dx \\ & = a x+\frac {1}{2} a \cos (x) \sin (x)-\frac {1}{2} a \int 1 \, dx \\ & = \frac {a x}{2}+\frac {1}{2} a \cos (x) \sin (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00 \[ \int \left (a-a \sin ^2(x)\right ) \, dx=a \left (\frac {x}{2}+\frac {1}{4} \sin (2 x)\right ) \]

[In]

Integrate[a - a*Sin[x]^2,x]

[Out]

a*(x/2 + Sin[2*x]/4)

Maple [A] (verified)

Time = 0.19 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.81

method result size
risch \(\frac {a x}{2}+\frac {a \sin \left (2 x \right )}{4}\) \(13\)
default \(a x -a \left (-\frac {\cos \left (x \right ) \sin \left (x \right )}{2}+\frac {x}{2}\right )\) \(18\)
parallelrisch \(-a \left (\frac {x}{2}-\frac {\sin \left (2 x \right )}{4}\right )+a x\) \(18\)
parts \(a x -a \left (-\frac {\cos \left (x \right ) \sin \left (x \right )}{2}+\frac {x}{2}\right )\) \(18\)
norman \(\frac {a \tan \left (\frac {x}{2}\right )+a x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+\frac {a x}{2}-a \left (\tan ^{3}\left (\frac {x}{2}\right )\right )+\frac {a x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{2}}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )^{2}}\) \(51\)

[In]

int(a-a*sin(x)^2,x,method=_RETURNVERBOSE)

[Out]

1/2*a*x+1/4*a*sin(2*x)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.75 \[ \int \left (a-a \sin ^2(x)\right ) \, dx=\frac {1}{2} \, a \cos \left (x\right ) \sin \left (x\right ) + \frac {1}{2} \, a x \]

[In]

integrate(a-a*sin(x)^2,x, algorithm="fricas")

[Out]

1/2*a*cos(x)*sin(x) + 1/2*a*x

Sympy [A] (verification not implemented)

Time = 0.02 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.94 \[ \int \left (a-a \sin ^2(x)\right ) \, dx=a x - a \left (\frac {x}{2} - \frac {\sin {\left (x \right )} \cos {\left (x \right )}}{2}\right ) \]

[In]

integrate(a-a*sin(x)**2,x)

[Out]

a*x - a*(x/2 - sin(x)*cos(x)/2)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.06 \[ \int \left (a-a \sin ^2(x)\right ) \, dx=-\frac {1}{4} \, a {\left (2 \, x - \sin \left (2 \, x\right )\right )} + a x \]

[In]

integrate(a-a*sin(x)^2,x, algorithm="maxima")

[Out]

-1/4*a*(2*x - sin(2*x)) + a*x

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.06 \[ \int \left (a-a \sin ^2(x)\right ) \, dx=-\frac {1}{4} \, a {\left (2 \, x - \sin \left (2 \, x\right )\right )} + a x \]

[In]

integrate(a-a*sin(x)^2,x, algorithm="giac")

[Out]

-1/4*a*(2*x - sin(2*x)) + a*x

Mupad [B] (verification not implemented)

Time = 13.57 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.69 \[ \int \left (a-a \sin ^2(x)\right ) \, dx=\frac {a\,\left (2\,x+\sin \left (2\,x\right )\right )}{4} \]

[In]

int(a - a*sin(x)^2,x)

[Out]

(a*(2*x + sin(2*x)))/4